package mymap

import "fmt"

func Test() {
	a := map[string]string{}

	a["name"] = "zhangsan"
	a["address"] = "qinghuadaxue"
	a["grade"] = "一年级"

	fmt.Println(a)
}

/*
给 map 赋值 空值，删除值
*/

func Test2() {
	var m1 map[string]string
	fmt.Printf("%v-%p", m1, m1)
}

func Test3() {
	m2 := map[string]string{"k1": "v1"}
	fmt.Println(m2)
	m2["k2"] = "v2"
	m2["k3"] = "v3"
	fmt.Println(m2)
	delete(m2, "k1")
	fmt.Println(m2)
	m2["k2"] = "value2"
	fmt.Println(m2)
}
